package com.sysu.minsysu.utils;

import java.util.ArrayList;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.sysu.minsysu.map.PlaceInfo;

public class Utils {
	public static GeoPoint getPoint( double latitude, double longitude ){
		return new GeoPoint( (int)( latitude*1E6), (int)( longitude*1E6) );
	}
	
	public static Bundle getBundleToStartMap( ArrayList<PlaceInfo> infos, double[] center ){
		Bundle bundle = new Bundle();
		bundle.putSerializable("infos", infos);
		bundle.putDoubleArray("centerPos", center);
		return bundle;
	}
	
	public static Bitmap[] getBitmaps( Resources res, Integer[] resNumber) {
		Bitmap[] bitmaps = new Bitmap[resNumber.length];
		for(int i=0; i<resNumber.length; ++i){
			bitmaps[i] = BitmapFactory.decodeResource(res, resNumber[i]);
		}
		return bitmaps;
	}
}
